package per.hx.bs.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import per.hx.bs.entity.sys.SysUserDO;

import java.util.List;
import java.util.Set;

/**
 * @author HuXing
 * @date 2018/3/11  10:47
 */
@Primary
@FeignClient(value = "Huxingbs-Sys-Service")
public interface CoreService {
    /**
     * 通过userId 获取用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     */
    @GetMapping(value = "sys-service/user/{userId}")
    SysUserDO getUserDOById(@PathVariable("userId") Long userId);

    /**
     * 用户登录
     *
     * @param loginName 用户名称
     * @return 用户信息
     */
    @GetMapping(value = "sys-service/user/login")
    SysUserDO userLogin(@RequestParam("loginName") String loginName);

    /**
     * 获取用户角色集合
     *
     * @param listRolesId 角色id
     * @return 用户角色集合
     */
    @GetMapping(value = "sys-service/role/roles")
    Set<String> listRoles(@RequestParam("listRolesId") List<Long> listRolesId);

    /**
     * 获取 用户权限集合
     *
     * @param listRolesId 角色id
     * @return 用户权限集合
     */
    @GetMapping(value = "sys-service/role/perms")
    Set<String> listPerms(@RequestParam("listRolesId") List<Long> listRolesId);

}
